package com.back_end.Reflection;

public class GetLoader {
    public static void main(String[] args) throws ClassNotFoundException {
        // 获取系统类（APP）加载器
        ClassLoader classLoader = ClassLoader.getSystemClassLoader();

        System.out.println(classLoader);


        // 获取系统类加载器的父类---扩展类加载器
        ClassLoader extClassLoader = ClassLoader.getSystemClassLoader().getParent();
        System.out.println(extClassLoader);


        // 获取扩展类加载器的父类加载器---根加载器(c/c++写的)
        ClassLoader rootClassLoader = ClassLoader.getSystemClassLoader().getParent().getParent();
        System.out.println(rootClassLoader);

        // 当前类的加载器
        Class<?> aClass = Class.forName("com.back_end.Reflection.GetLoader");

        ClassLoader classLoader1 = aClass.getClassLoader();
        System.out.println(classLoader1);

        // Object的类加载器---JDK内置类
        Class<?> aClass1 = Class.forName("java.lang.Object");
        System.out.println(aClass1.getClassLoader());

        // 如何获取系统类加载器可以加载的路径
        System.out.println(System.getProperty("java.class.path"));

        /*
        * C:\Program Files (x86)\Java\jdk\jre\lib\charsets.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\deploy.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\access-bridge-64.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\cldrdata.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\dnsns.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\jaccess.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\jfxrt.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\localedata.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\nashorn.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\sunec.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\sunjce_provider.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\sunmscapi.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\sunpkcs11.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\ext\zipfs.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\javaws.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\jce.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\jfr.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\jfxswt.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\jsse.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\management-agent.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\plugin.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\resources.jar;
        * C:\Program Files (x86)\Java\jdk\jre\lib\rt.jar;
        * F:\AAA_Self_Study\Study_DEMO\out\production\Study_DEMO;
        * E:\AAACompeang\APp\idea\idea64\lib\idea_rt.jar
        *
        * */



    }


}
